package View;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Container;
import java.awt.EventQueue;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JDesktopPane;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;

public class MainInterface extends JFrame {

	private JPanel contentPane;
	protected Container desktopPane;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					MainInterface frame = new MainInterface();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public MainInterface() {
		setTitle("\u4E3B\u7A97\u53E3");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 932, 631);
		
		
		
		
		
		JMenuBar menuBar = new JMenuBar();
		setJMenuBar(menuBar);
		
		JMenu menu = new JMenu("\u754C\u9762\u9009\u62E9");
		menuBar.add(menu);
		
		JMenuItem mu_user = new JMenuItem("\u7528\u6237\u754C\u9762");
		mu_user.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				UserInterface userinterface=new UserInterface();
				userinterface.setVisible(true);
				desktopPane.add(userinterface);
			}
		});
		menu.add(mu_user);
		
		JMenuItem mu_manage = new JMenuItem("\u7BA1\u7406\u5458\u754C\u9762");
		mu_manage.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				ManageInterface mbv=new ManageInterface();
				mbv.setVisible(true);
				desktopPane.add(mbv);
			}
		});
		menu.add(mu_manage);
		
		JMenuItem mu_exit = new JMenuItem("\u9000\u51FA");
		menu.add(mu_exit);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		desktopPane = new JDesktopPane();
		desktopPane.setForeground(Color.BLACK);
		desktopPane.setBackground(Color.BLACK);
		desktopPane.setBounds(0, 0, 960, 571);
		contentPane.add(desktopPane);
		
		
	}

}
